package models;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the loan_in_funding database table.
 * 
 */
@Entity
@Table(name="LOAN_IN_FUNDING")
public class LoanInFunding implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(
            name = "LOAN_IN_FUNDING_SEQ",
            table = "SEQUENCE",
            pkColumnName = "NAME",
            pkColumnValue = "LOAN_IN_FUNDING_SEQ",
            valueColumnName = "CNT",
            initialValue = 10000,
            allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "LOAN_IN_FUNDING_SEQ")
	@Column(unique=true, nullable=false)
	private Integer id;

	private Integer aid;

	@Column(name="APP_AMOUNT")
	private double appAmount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="APP_D")
	private Date appD;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_D")
	private Date createD;

	@Column(name="LOAN_ID")
	private Integer loanId;

	@Column(name="UNFUNDED_AMOUNT")
	private double unfundedAmount;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="UPDATE_D")
	private Date updateD;

	public LoanInFunding() {
	}

	public LoanInFunding(int aid, int loanId, double amount, Date appDate){
	    this.aid = aid;
	    this.loanId = loanId;
	    this.appAmount = amount;
	    this.appD = appDate;
	    this.unfundedAmount = amount;
	    this.createD = new Date();
	}
	
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getAid() {
		return this.aid;
	}

	public void setAid(Integer aid) {
		this.aid = aid;
	}

	public double getAppAmount() {
		return this.appAmount;
	}

	public void setAppAmount(double appAmount) {
		this.appAmount = appAmount;
	}

	public Date getAppD() {
		return this.appD;
	}

	public void setAppD(Date appD) {
		this.appD = appD;
	}

	public Date getCreateD() {
		return this.createD;
	}

	public void setCreateD(Date createD) {
		this.createD = createD;
	}

	public Integer getLoanId() {
		return this.loanId;
	}

	public void setLoanId(Integer loanId) {
		this.loanId = loanId;
	}

	public double getUnfundedAmount() {
		return this.unfundedAmount;
	}

	public void setUnfundedAmount(double unfundedAmount) {
		this.unfundedAmount = unfundedAmount;
	}

	public Date getUpdateD() {
		return this.updateD;
	}

	public void setUpdateD(Date updateD) {
		this.updateD = updateD;
	}

}